<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="../../css/weui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../css/jquery-weui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
    <link rel="stylesheet" type="text/css" href="../../css/order.css" />
    <title>上传发票快递单</title>
    <script src="../../js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/baseConfig.js" type="text/javascript" charset="utf-8"></script>
    <script src=" http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>

<body>
    <!--<div id="header">
			<div class="header-title" style="position: fixed;top: 0;">
				<img src="../../img/left.png" class="left" />
				<span>签章合同</span>
			</div>
		</div>-->
    <div class="invoice_warp" style="margin-top: 0;">
        <div class="weui-cells weui-cells_form">
            <form method="post" id="form1" action="##" enctype="multipart/form-data">
                <div class="weui-cell" style="padding: 0;">
                    <div class="weui-cell__bd">
                        <div class="weui-uploader__bd">
                            <ul class="weui-uploader__files">

                            </ul>
                            <div class="weui-uploader__input-box">
                                <input id="uploaderInput" name="file" class="weui-uploader__input js_file" type="file" accept="image/*">
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

        <div class="demos-content-padded">
            <a href="javascript:;" class="weui-btn weui-btn_primary">确定</a>
        </div>
    </div>
    <div class="imgWarp" style="margin-top: 0;">
        <!--<img src="../../img/photo.png"/>-->
    </div>
    <div class="weui-gallery" style="display: none">
        <span class="weui-gallery__img"></span>
    </div>
</body>
<script type="text/javascript">
    $(document).ready(function() {
        baseConfig.historyBack()
        baseConfig.singleImgupload()
        $(".weui-btn").on("click", function() {
            var formData = new FormData($("#form1")[0])
            formData.append("orderNo", baseConfig.GetQueryString("orderNo"));
            $.ajax({
                type: "post",
                url: baseConfig.localHttp + "weChatApi/fgclient/uploadClientDelivery",
                data: formData,
                contentType: false,
                processData: false,
                success: function(data) {
                    console.log(data)
                    if (data.code == 100) {
                        $.toptip("图片上传成功", 1200, 'success')
                        setTimeout(function() {
                            location.href = "mine.html"
                        }, 1200)
                    } else {

                    }
                },
                error: function() {
                    $.hideLoading();
                    $.toast("请求失败", "cancel");
                }
            })
        })
    })
</script>

</html>